import org.kwis.msp.lcdui.Jlet;
import org.kwis.msp.lcdui.Display;
import org.kwis.msp.lwc.ShellComponent;
import org.kwis.msp.lwc.FormComponent;
import org.kwis.msp.lwc.LabelComponent;
import org.kwis.msp.lwc.ButtonComponent;


public class FormComponentEx1 extends Jlet{


	class ExtendedForm extends FormComponent{

		private int gab;

		public ExtendedForm(){
			super();
		}

		public ExtendedForm(int x ){
			super();
			setGab(x);
		}
		
		public ExtendedForm(boolean b , int x ){
			super(b);
			setGab(x);
		}

	}


	Display displayLCD ;
	ShellComponent shell;
	ExtendedForm form;
		

	public FormComponentEx1(){
		displayLCD = Display.getDefaultDisplay();
		shell = new ShellComponent();
	}

	protected void startApp(String[] arg0){

		LabelComponent label1 = new LabelComponent("Label 1");
		LabelComponent label2 = new LabelComponent("Label 2");
		LabelComponent label3 = new LabelComponent("Label 3");
		ButtonComponent button1 = new  ButtonComponent("Button",null);

		label1.setBackground(0x00ffff00);
		label2.setBackground(0x00ff0000);
		label3.setBackground(0x00ff00ff);


		form = new ExtendedForm(10);

		form.addComponent(label1);
		form.addComponent(label2);
		form.addComponent(label3);
		form.addComponent(button1);

		shell.addComponent(form);
		shell.setTitle("   Form Component");

		displayLCD.pushCard(shell.getCard());
		
	}

	protected void destroyApp(boolean arg0) {  }

}
